#ifndef DIFFRACTION_H
#define DIFFRACTION_H

#include "classes.h"
#include <QProgressBar>
#include <QTextBrowser>
#include <QFile>
#include <QTextIStream>
#include <gsl/gsl_linalg.h>

class Diffraction : public Structure {   //for propagating waves
public:
    Diffraction();
    Diffraction(Structure *);
    int numCoef[3]; // number of coefs
    gsl_complex eps,Refract;

    void approximation(QTextBrowser *);
    gsl_complex cofactor(int,int);
    void cauchy(QTextBrowser *);
    void matrix(QTextBrowser *);
    void stepByStep(QTextBrowser *);
    //void coeffs(QProgressBar *);

private:

    bool losses; // flag of dissipation in II & III areas
    gsl_complex getBeta(int,int,double);
    gsl_vector_complex *ABC, *XYZ, *RGHT; // alternate components & rightpart vector

    void ortodox(QTextBrowser *);
    void analitic(QTextBrowser *);
    void analiticE(QTextBrowser *);
    void withoutInt(QTextBrowser *);
    void withoutInt2(QTextBrowser *);
    void diffract(QTextBrowser *);
    void diff_new(QTextBrowser *);
    void wenger(QTextBrowser *);
    //void wenger2(QTextBrowser *);
    void diff_check(QTextBrowser *);
    double amq(double,double);
    double bnq(double,double);
    double b0q(double);

};

#endif // DIFFRACTION_H
